<html><head><title>Calculating With Dates and Times</title><meta name="filename" content="text/scalc/guide/calc_date"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
table.Tabelle1{
}
span.Tabelle1A{
width:18cm;}
td.Tabelle1A1{
}
p.P1{
}
p.P2{
}
span.T1{
font-weight:bold;}
span.fr1{
}
</style></head><body>
<p class="P1"/>
<p class="Head1"><help:key-word value="dates; in cells" tag="kw68068_1" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="times; in cells" tag="kw68068_4" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="cells; time formats" tag="kw68068_3" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="cells; date formats" tag="kw68068_2" xmlns:help="http://openoffice.org/2000/help"/><help:to-be-embedded Eid="calc_date" xmlns:help="http://openoffice.org/2000/help"><help:link Id="68068">Calculating With Dates and Times</help:link></help:to-be-embedded></p>
<p class="Paragraph">In spreadsheets you can do more than just display dates and times (both taken from the internal clock of your computer). You can also perform calculations with dates and times. For instance, to find out exactly how old you are in seconds or hours, follow these steps:</p>
<p class="P2">Open a new spreadsheet. Enter your birthday in cell A1, e.g., "4/9/64".</p>
</li>
<li class="">
<p class="P2">Enter the following formula in cell A3: =NOW()-A1</p>
</li>
<li class="">
<p class="P2">After pressing the Enter key or clicking the Accept icon (the green check mark on the formula bar) you will see the result in date format. Since you would like to see the difference between two dates as a number of days, you have to format cell A3 as a number.</p>
</li>
<li class="">
<p class="P2">Set the cursor in cell A3, right-click this cell (i.e. call its context menu) and choose <span class="T1">Format Cells...</span>.</p>
</li>
<li class="">
<p class="P2">The <span class="T1">Cell Attributes</span> dialog will appear. On the <span class="T1">Numbers</span> tab, the <span class="T1">Number</span> category will appear already highlighted. The format is set to "General" and causes, among other things, the result of a calculation containing date entries to also be displayed as a date. If you want to make a number be displayed instead, set the number format to "-1,234" for example, and close the dialog with the <span class="T1">OK</span> button.</p>
</li>
<li class="">
<p class="P2">You should now see in cell A3 the number of days between today's date and the specified date.</p>
</li>
<li class="">
<p class="P2">Experiment with some additional formulas: in A4 enter =A3*24 to calculate the hours, in A5 enter =A4*60 for the minutes, and in A6 enter =A5*60 for seconds. Press the Enter key after each formula.</p>
</li>
</ol>
<p class="Paragraph">The time since your date of birth will be calculated and displayed in the various units. The values are calculated as of the exact moment when you entered the last formula and pressed the Enter key. This value is not automatically updated, although "Now" continuously changes, of course. In the <span class="T1">Tools</span> menu, the menu item <span class="T1">Cell Contents - AutoCalculate</span> is normally active; however, automatic calculation does not apply to the function NOW. If it were, your computer would be solely occupied with updating the sheet.</p>